package com.yiman.project.system.web;

import com.yiman.project.system.model.Menu;
import com.yiman.project.system.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author: ym
 * @create: 2019-05-01
 **/
@Controller
public class IndexController {
    @Autowired
    MenuService menuService;

    @RequestMapping("/index")
    public String index(ModelMap map){
        List<Menu> menus = menuService.selectMenusByUserId("11");
        System.out.println("登录认证通过进入index页面");
        map.put("menus",menus);
        return "index";
    }


    @RequestMapping("/testData")
    //@ResponseBody
    public String testData(ModelMap map){
        map.put("menus",menuService.selectMenusByUserId("11"));
        map.put("rer","34234243234");
        return "test";
        //return JSON.toJSONString(map);
    }
    @RequestMapping("/testPage")
    public String testPage(){

        return "test";

    }
}
